<?php
session_start();
if (empty($_SESSION['username'])) {
    echo '<script type="text/javascript">window.location.href="index.php";</script>';
} else {
    $now = time();
    if ($now > $_SESSION['expire']) {
        session_destroy();
        echo '<script type="text/javascript">var r=confirm("Session expire (30 mins)!"); if(r==true){window.location.href="../index.php";}else{window.location.href="index.php";}</script>';
    } else {
        require '../model-db-connection/config.php';
        $config = require '../model-db-connection/qrc_conf.properties.php';
    }
}
?>
<div class="panel panel-red">
    <div class="panel-heading">
        <div class="row">
            <div class="col-xs-3">
                <i class="fa fa-support fa-5x"></i>
            </div>
            <div class="col-xs-9 text-right">
                <?php
                $sqlCountBuilder = "SELECT count(*) as count_builder FROM QRC_TEAM_BUILDER ";
                $sqlCountTeam = "SELECT count(*) as count_member FROM QRC_MEMBERS ";
                $queryGetCountBuilder = mysql_query($sqlCountBuilder);
                $queryGetCountMembers = mysql_query($sqlCountTeam);
                while ($rowBuilder = mysql_fetch_assoc($queryGetCountBuilder)) {
                    while ($rowMember = mysql_fetch_assoc($queryGetCountMembers)) {
                        echo '<div class="huge">' . $rowBuilder['count_builder'] . '/' . $rowMember['count_member'] . '</div>';
                    }
                }
                ?>
                <div>Team(s)/Member(s)</div>
            </div>
        </div>
    </div>
    <a href="../team-page/index-team.php">
        <div class="panel-footer">
            <span class="pull-left">View Details</span>
            <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
            <div class="clearfix"></div>
        </div>
    </a>
</div>